import {
  ADD,
  MINUS
} from '../constants/actionTypes'

const defaultState = {
  count: 0
}

export const numHandle = (state = defaultState, action) => {
  switch (action.type) {
    case ADD:
      return { ...state, count: state.count + 1 };
    case MINUS:
      return { ...state, count: state.count - 1 };
    default:
      return state;
  }
}